function main() {
	var ctx = document.getElementById('canvas').getContext('2d');
	draw_background(ctx, '#99cc33');
	ctx.strokeStyle="white";
	draw_line(ctx, point(0, 0), point(400,300)); 
}

function point(x, y) {
	return {x:x, y:y}
}

function draw_line(ctx, p1, p2) {
	ctx.beginPath();
	ctx.moveTo(p1.x,p1.y);
	ctx.lineTo(p2.x,p2.y);
	ctx.stroke();
}

var CANVAS_W = 800;
var CANVAS_H = 600;

function draw_background(ctx, color) {
	ctx.fillStyle=color;
	ctx.fillRect(0, 0, CANVAS_W, CANVAS_H);
}
 
